home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9592 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: dildog.lgc.com!usenet
  2. From: Glenn Carr <gcarr@tulsa.lgc.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Incorporating build date into an executable?
  5. Date: Mon, 11 Mar 1996 16:52:28 -0600
  6. Organization: Landmark Graphics
  7. Message-ID: <3144AEAC.2F1C@tulsa.lgc.com>
  8. NNTP-Posting-Host: 134.132.131.47
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (X11; I; AIX 1)
  13.  
  14. What is the best way to incorporate the build date into an executable?
  15.  
  16. Currently, I'm defining macros for the preprocessor when I compile...
  17.  
  18. -DBUILD_INFO_DATE=\"`date "+%d-%h-%y"`\"  -DBUILD_INFO_TIME=\"`date "+%H:%M"`\"
  19. -DBUILD_INFO_TZ=\"`date | cut -f6 -d\ `\"  -DBUILD_INFO_VERS=\"`uname -v`\"
  20. -DBUILD_INFO_REL=\"`uname -r`\"  -DBUILD_INFO_OS=\"`uname -s`\"
  21.  
  22. I've setup the Imakefile for my main.c to include these flags when building, but
  23. our app uses several internal object libraries which also cause the app to be
  24. built.  Is there a better way to stamp the executable with this information?
  25. I'd rather not pass in this mess, but would like to include it a header file
  26. that is updated right before the link.  Any other better ways to do it?
  27.